-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prototype generic process functions #1000
base: develop
Are you sure you want to change the base?
Prototype generic process functions #1000
Conversation
…ericProcess class
… which does not exist
@ikelos - I'd love your thoughts on this. The idea to have a simple to use way to get key information about a process for plugins. That way there can be a central way to do these lookups within plugins so that they're consistent and if an update needs to be done it only needs to happen in one place. It could be bulked out to include extra bits for a process like getting memory regions etc. It should hopefully mean that we'd be able to make non-OS specific plugins - assuming it's done in the right way. Given it's above intel process that might be a good place for it given the arm work at the moment? Thanks again. |
Yep, sorry, it is on my list, just a bit lower down at the moment, sorry! 5:S |
Hey @eve-mem ! It's a great idea to ensure better consistency across the framework. I think this is also related to your other ticket Unify Linux plugins representation of pids which we should take a decision at some point. |
Thanks both. I completely understand not having time to look at this given how little time i seem to have at the moment. Thanks for those pointers @gcmoreira - that's almost exactly why I'd pike something like this PR to exist. Just a single place to have the 'right' answer so we can do it once for all plugins. Not necessarily this version in particular, but the idea at least. |
…t is readable and remove unneeded source code
Hey @ikelos and @gcmoreira, I was working on the PR for #981 and it just felt to me that doing this first might make it all a bit easier. Assuming that you both think that this is a good idea of course! What do you think? I also tried to add an explanation of tgid/pid/tid into the readme docs. Not sure what you both make of that? @gcmoreira thanks for the comments - I think I've got them all now. I'm a little unsure I got the datetime part correct in the mac side - could you check that a little closer? Thanks both. |
Hey @eve-mem good job! I think it's a solid idea, but we should keep refining the implementation. There are a few areas that could be improved, and some issues that still need fixing.
- user_pid = task.get_pid()
- user_tid = task.pid # Note that pid is user_tid in Linux
- user_ppid = task.get_parent_pid()
+ user_pid = task.get_user_pid()
+ user_tid = task.get_user_tid()
+ user_ppid = task.get_user_ppid()
# or get_parent_user_pid()
|
Thanks @gcmoreira - makes sense I'll work on it. Particularly the pid filtering, it makes sense to me now. I was hoping that the functions would be the same across the different OSes, I'll change the get_pid to get_user_pid for all of them. |
Hello,
This draft PR is to add some experimental features to provide a generic way of getting basic information from processes regardless of operating system. The idea was discussed in the comments of this issue: #981
The idea being to provide a set of functions that can be used in plugins to make them easier to make (or volshell), and be consistent across the different operating systems so it's easier to switch between them.
It is very basic, just adding the following functions. Mostly just be shifting code out of various pslist plugins to the extensions so they can used from anywhere.
(This is what I mean with the colours if it's not clear - 🟢: Added in this PR, ⚫: Function already existed, 🔴: Not added in this PR)
It was interesting to work on this. I noticed after that the linux module class also inherits from
GenericIntelProcess
and already has aget_name
function.Also that the windows EPROCESS already had the
get_create_time
andget_exit_time
functions so I used those names in the generic part.I've then modified the pslist plugins for windows/linux/mac to show how this could be used. If this is useful I'm happy to modify the existing plugins to use this, it shouldn't affect how they work - but might make them easier to read.
I'm not sure if this is the best (or even a good) way of doing this - so I'd be very interested in your thoughts.
Thanks!